Fix register-use-preview behavior with never value
authorThierry Volpiatto <thievol@posteo.net>
Wed, 5 Mar 2025 09:37:03 +0000 (10:37 +0100)
committerThierry Volpiatto <thievol@posteo.net>
Wed, 5 Mar 2025 13:34:43 +0000 (14:34 +0100)
Allow popping up preview when pressing C-h.

Don't exit the minibuffer when the call to
register-read-with-preview-fancy is triggered by C-h.

* lisp/register.el (register-read-with-preview-fancy): Do it.

lisp/register.el

index b0ee759ec5b9709486f51a4783f30dd85c6202c1..373d7e545500a9550a2086dc4dc83b49d8555f15 100644 (file)
@@ -569,7 +569,11 @@ or \\='never."
                        (setq pat input))))
                  (if (setq win (get-buffer-window buffer))
                      (with-selected-window win
-                       (when noconfirm
+                       (when (or (eq noconfirm t) ; Using insist
+                                 ;; Don't exit when noconfirm == (never)
+                                 ;; If we are here user has pressed C-h
+                                 ;; calling `register-preview-1'.
+                                 (memq nil noconfirm))
                          ;; Happen only when
                          ;; *-use-preview == insist.
                          (exit-minibuffer))